import request from '@/utils/request'

// 获取所有设备
export function getAllProbes(currentPage, pageSize) {
  return request({
    url: '/shike3k/allProbe/getAllProbes/' + currentPage + '/' + pageSize,
    method: 'get'
  })
}

// 新增设备
export function AddProbe(data) {
  return request({
    url: '/shike3k/allProbe/addProbeByScanCode',
    method: 'post',
    data
  })
}

// 删除设备
export function DelProbe(probeId) {
  return request({
    url: '/shike3k/allProbe/deleteProbe/' + probeId,
    method: 'post',
    data: { probeId }
  })
}

//根据设备ID找设备
export function searchProbeByProbeId(id){
  return request({
    url:'/shike3k/allProbe/getProbesById',
    method: 'get',
    params: { id } 
   })
}

//根据区域ID找设备
export function searchProbeByareaId(areaId,currentPage,pageSize){
  return request({
    url: '/shike3k/allProbe/getProbeByAreaId/'+areaId+'/'+currentPage+'/'+pageSize,
    method: 'get'
  })
}


//根据用户ID找设备
export function searchProbeByUserId(userId){
  return request({
    url:'/shike3k/allProbe/getProbeByUserId/'+userId,
    method: 'get'
  })
}

//根据区域名找设备
export function searchProbeByareaName(areaName,currentPage,pageSize){
  return request({
    url: '/shike3k/allArea/findAreaByName/'+areaName+'/'+currentPage+'/'+pageSize,
    method: 'get'
  })
}

